package com.baidu.foody.bindingadapter

import android.view.View
import android.widget.Toast
import androidx.navigation.findNavController
import com.baidu.foody.R
import com.baidu.foody.viewmodel.MainViewModel

class ClickEvents {
    fun showBottomSheetDialog(v: View, viewModel: MainViewModel){
        if (viewModel.networkAvailable) {
            v.findNavController().navigate(R.id.action_recipeFragment_to_bottomSheetDialogFragment)
        }else{
            Toast.makeText(v.context, "no network connection", Toast.LENGTH_SHORT).show()
        }
    }
}